const { mock, Random } = require('mockjs')

Random.extend({
  constellations: ['白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座', '水瓶座', '双鱼座'],
  constellation: function (date) {
    return this.pick(this.constellations)
  }
})
Random.constellation()
// => "水瓶座"
mock('@CONSTELLATION')
// => "天蝎座"
const { data1 } = mock({
  'data1|6': [
    {
      'code|+100000': 330100000,
      value: function () { return Random.integer(6, 66) * 100 },
      constellation: '@CONSTELLATION'
    }]
})
data1.map(item => {
  if (item.value > 0 && item.value < 1551) { item.color = 'red' }
  if (item.value >= 1551 && item.value < 3102) { item.color = 'black' }
  if (item.value >= 3102 && item.value < 4653) { item.color = 'white' }
})
console.log(data1)
